#include<stdio.h>

int main()
{
	int n,a,b,s,i,f1,f2,f3;
	scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		f1=0;
		f2=0;
		f3=0;
		scanf("%d%d",&a,&b);
		s=a+b;
		while (s>0)
		{
			f1=10*f1+s%10;
			s=s/10;
		}
		while (a>0)
		{
			f2=f2*10+a%10;
			a=a/10;
		}
		while (b>0)
		{
			f3=f3*10+b%10;
			b=b/10;
		}
		if (f1==f2+f3)
			puts("YES");
		else
			puts("NO");
	}
	return 0;
}
